home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fatted Calf
/
The Fatted Calf.iso
/
Modules
/
BackSpaceModules
/
Source
/
Bezier
/
BezierWraps.psw
< prev
next >
Wrap
Text File
|
1992-04-02
|
2KB
|
69 lines
/* ------------ These wraps are all for bezier ---------------- */
/* This bezier hack was mostly written by mike dixon. -s */
defineps PSWbezierCreate()
128 array /myArray exch def
/h 0 def %starting hue
/setnewcolor %tweak the hue
{
h 1 50 div add
dup 1 gt { 1.0 sub } if
dup /h exch def
1 1 sethsbcolor
} def
/adj { % dx
rand 50000000 idiv add dup 0 le {-5}{5} ifelse add }
bind def % dx'
/upd { % dx x max
yield exch 2 index add 2 copy le % dx max x' over?
{ 1 index sub sub exch neg adj neg exch }
{ exch pop dup 0 lt { neg exch adj exch } if }
ifelse }
bind def % dx' x'
/xtr { % dxa xa dya ya dxb xb dyb yb ...
14 index 13 index 12 index 11 index 10 index 9 index 8 index 7 index }
bind def % dxa xa dya ya dxb xb dyb yb ... xa ya xb yb ...
/updl { % dxa xa dya ya dxb xb dyb yb ...
xtr 24 8 roll
4 { ht upd 16 2 roll wd upd 16 2 roll } repeat
% xa ya xb yb ... dxa' xa' dya' ya' dxb' xb' dyb' yb' ...
setnewcolor xtr moveto curveto stroke
}
bind def
/updlNoDraw {
xtr 24 8 roll
4 { ht upd 16 2 roll wd upd 16 2 roll } repeat
xtr 8 { pop } repeat
}
bind def
endps
defineps PSWbezierInit(float width, height)
/wd width def
/ht height def
1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1
14 { updlNoDraw } repeat
myArray astore pop
endps
defineps PSWbezierOneStep()
myArray aload pop
128 -8 roll 0 setgray moveto curveto stroke updl
myArray astore pop
endps